Skip to content

[feat] Add Google Maps links and fix event end times and time zone - #154

Merged
multiplegeorges merged 2 commits into
mainfrom
feat/event-location-and-times
Aug 7, 2026
Merged

[feat] Add Google Maps links and fix event end times and time zone#154
multiplegeorges merged 2 commits into
mainfrom
feat/event-location-and-times

Conversation

@multiplegeorges

Copy link
Copy Markdown
Contributor

Summary

Three things about how events show up on the site.

Locations are now clickable. Every event block — home page and past events — carries an "Open in Google Maps" link under the address. The address itself stays plain text: location is ActionText, so it can contain its own links, and wrapping it in an anchor would nest <a> tags.

Events stay up until they're over. An event used to vanish from the home page the moment it started, so anyone checking the site on their way to a meetup found nothing. upcoming/past now pivot on the end time.

Times render in Toronto time. The admin dashboard listed every event 3–5 hours ahead of when it actually starts — an 8pm meetup showed as midnight or 1am the next day.

Building the Maps query

Locations are written as a venue name, then a street address, then arrival instructions:

Workplace One
51 Wolseley St, Toronto ON
Lower level, enter through doors on Wolseley St.

Handing all of that to Maps degrades the search — the FinanceIt entry ends with two full sentences about elevator banks and a 7pm door policy. Event#map_query keeps the first two lines and appends city when the address doesn't already name it. Against the real seed data:

Location Query
Workplace One Workplace One, 51 Wolseley St, Toronto ON
Loop Financial Loop Financial, 500-410 Adelaide Street West, Toronto, ON M5V 1S8
FinanceIt @ The Well FinanceIt @ The Well, 8 Spadina Ave, Toronto, Canada

The trade-off worth knowing: if a future location puts the street on line 3 or later, the link points at the venue name alone. Maps usually still resolves it, but it's a heuristic, not a guarantee.

Event duration

There's no end-time column, and this doesn't add one — Event::DURATION = 3.hours encodes what the meetups actually run. Calendar was already hard-coding the same three hours for the ICS dtend; it now shares Event#end_at, so the calendar feed and the site can't drift apart.

Time zone

config.time_zone was never set, so it defaulted to UTC and any bare strftime rendered UTC. Setting it once fixes the class of bug rather than the one instance, and lets three scattered workarounds go: Event#start_time, the admin form's start_at value, and the controller's TZ_STRING round-trip on create/update.

Two things to know about the blast radius:

  • Storage is unchanged. active_record.default_timezone still defaults to :utc, so this is a display change only — no migration, no data touched.
  • Past Events groups by Eastern year now, not UTC year. A December 31st evening meetup is already January 1st in UTC, so it used to file under the following year; it now files correctly.

Validation

Full suite green — 29 runs, 94 assertions, 0 failures.

New coverage, each verified to fail without its fix:

  • An in-progress event appears on the home page and not in Past Events; a finished one flips.
  • The rendered event block contains the Maps URL.
  • Admin index renders November 25, 2024 at 7:30 PM for a 2024-11-26 00:30 UTC event. Before the config change the same test renders November 26, 2024 at 12:30 AM — confirmed by reverting config/application.rb and re-running.

The existing admin create test already pinned the form round-trip (2024-11-25T19:30 submitted → 19:30-05:00 stored), which is what makes dropping TZ_STRING safe.

Every event block now carries an "Open in Google Maps" link under its
address, on both the home page and the past events page.

Events also stay on the home page until they're actually over rather than
disappearing the moment they start. Meetups run about three hours, so
Event::DURATION captures that and the upcoming/past scopes pivot on the end
time. Calendar was already hard-coding the same three hours for the ICS
dtend; it now shares Event#end_at so the feed and the site can't drift apart.
The admin dashboard listed every event three to five hours ahead of when it
actually starts — an 8pm meetup showed as midnight or 1am the next day. The
app never set config.time_zone, so it defaulted to UTC and any bare strftime
rendered UTC.

Setting the zone once fixes it at the root and lets three scattered
workarounds go: Event#start_time, the admin form's start_at value, and the
controller's TZ_STRING round-trip on create/update. Storage is unchanged —
ActiveRecord still persists UTC.
@multiplegeorges
multiplegeorges merged commit c8b8c80 into main Aug 7, 2026
1 check passed
@multiplegeorges
multiplegeorges deleted the feat/event-location-and-times branch August 7, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant